package com.leon.spring_security_oauth2.auth_util;

import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;

public class SecurityUtils {

    public static Authentication getAuthentication() {
        return SecurityContextHolder.getContext().getAuthentication();
    }

    public static UserDetailsImpl getUserDetailImpl(){
        return (UserDetailsImpl) SecurityUtils.getAuthentication().getPrincipal();
    }
}
